<?php
	include_once("../sql_connect.php");

	/*根据昵称查找*/

	/*取得，搜索人的u_no*/
	$u_name = $_POST[u_name];

	$my_sql = mysql_query("select u_no from user_info where u_name  LIKE '%$u_name%'");
	$my_result = mysql_fetch_array($my_sql);
	
	$find_content = "";
	if($my_result){
	do{
		$find_content .= "<div class='cencerns_box'>";
		$find_content .= "<div class='cencerns_img'><img src=";
		
		$c_no = $my_result[0];
		
		/*输出头像*/
    	$show_head_sql = mysql_query("select h_data from head where u_no='$c_no'",$connection);
    	$show_head_result = mysql_fetch_array($show_head_sql);
    	$my_data = $show_head_result[h_data];
    	if (!$my_data){
    		$find_content .= "'head_image/09.jpg' width='45' height='45' border='0' /></div>";
    	}
    	else $find_content .= "'".$my_data."'width='45' height='45' border='0' /></div>";
    	
    	/*输出昵称*/
    	$find_content .= "<div class='cencerns_name'>";
    	$user_sql = mysql_query("select u_name from user_info where u_no='$c_no'",$connection);
    	$user_result = mysql_fetch_array($user_sql);
    	$user_data = $user_result[0];   						
    	$find_content .= $user_data."</div>";
    	
    	/*显示学院*/
    	$find_content .= "<div class='cencerns_from'>";
    	$user_sql = mysql_query("select u_dept from user_detail where u_no='$c_no'",$connection);
    	$user_result = mysql_fetch_array($user_sql);
    	$user_data = $user_result[0];   						
    	$find_content .= $user_data."</div>";
    	
    	$find_content .= "<div class='cencerns_button'><a href='##'>取消关注</a></div>";
      
    	/*输出关注数、粉丝数，以及微博数*/
    	$find_content .= "<div class='cencerns_f'>关注";

    	/*显示关注数量*/
    	$show_sql = mysql_query("select max(c_num) from concerns where u_no='$c_no'",$connection);
    	$show_result = mysql_fetch_array($show_sql);
    	$my_data = $show_result[0];   						
    	$find_content .= $my_data;
    	/*显示粉丝数量*/
    	$find_content .= "&nbsp;&nbsp;|&nbsp;&nbsp;粉丝";
    	$show_sql = mysql_query("select max(f_num) from concerns where c_no='$c_no'",$connection);
    	$show_result = mysql_fetch_array($show_sql);
    	$my_data = $show_result[0];   						
    	$find_content .= $my_data;
    	/*显示微博数量*/
    	$find_content .= "&nbsp;&nbsp;|&nbsp;&nbsp;微博";
    	$show_sql = mysql_query("select max(w_num) from weibo where u_no='$c_no'",$connection);
    	$show_result = mysql_fetch_array($show_sql);
    	$my_data = $show_result[0];   						
    	$find_content .= $my_data."&nbsp;&nbsp;</div>";
    	
    	/*显示简介*/
    	$find_content .= "<div class='cencerns_info'>简介:";
    	$user_sql = mysql_query("select u_mydesc from user_detail where u_no='$c_no'",$connection);
    	$user_result = mysql_fetch_array($user_sql);
    	$user_data = $user_result[0];   						
    	$find_content .= $user_data."</div><span class='border_cen2'></span></div>";

  	}while ($my_result = mysql_fetch_array($my_sql));
	}
	echo $find_content;

?>
      
      
      

      
      
      